package cn.dankal.flyaudio.home

import api.ActivityServiceFactory
import cn.dankal.basiclib.base.fragment.BaseRecyclerViewFragment.PAGE_SIZE
import cn.dankal.basiclib.base.recyclerview.BaseRecyclerViewPresenter
import cn.dankal.basiclib.rx.AbstractStateSubscriber
import cn.dankal.business.pojo.ActivityBean
import cn.dankal.business.pojo.BaseBeanList

class ActivityPrsenter(private val search: String?) : BaseRecyclerViewPresenter<ActivityBean>() {
    override fun requestData(pageIndex: String?) {
        ActivityServiceFactory.activity_list(search,pageIndex,PAGE_SIZE)
                .subscribe(object :
                        AbstractStateSubscriber<BaseBeanList<ActivityBean>>(view) {
                    override fun onNext(t: BaseBeanList<ActivityBean>) {
                        this@ActivityPrsenter.view.render(t.list)
                    }
                })

    }
}